-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Reimplement the Zooming Image Tool [Sumac backport] #36027
feat: Reimplement the Zooming Image Tool [Sumac backport] #36027
Conversation
The Zooming Image Tool does not load properly, currently, and even if it did, relying on an external Javascript to function across releases is not something we can support. Thus, we remove it from the list of HTML block templates until such time as a more robust solution is found.
This recreates the Zooming Image Tool template for the HTML block. It does it in such a way that doesn't depend on any external resources: both the loupe code and sample image are inlined. Some benefits to this version are: * We can now maintain the loupe javascript code properly * Because the javascript is included in the contents of the block itself, the course author can customize it as needed * As opposed to the previous iteration, the magnified image URL is now optional: if it's not present, the regular image will be used for magnification * There can now be two or more instances of the tool in the same unit. This also removes some CSS left over from the previous iteration.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you rock @arbrandes
I was just surprised by the changes to test_block.py. That wasn't part of master PR #36012 was it?
) | ||
self.assertEqual(resp.status_code, 200) | ||
html, __ = self._get_container_preview(split_test_usage_key) | ||
self.assertIn("Announcement", html) | ||
self.assertIn("Zooming", html) | ||
self.assertIn("LaTeX", html) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where did this come from?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test suite for these templates just randomly included some of them (and not others). When removing the tool originally, I just added another random one. 🤷🏼
bc17b35
into
openedx:open-release/sumac.master
@pdpinch, the changes were part of the original removal PR, which got included here as well. |
This is a backport of #36012 to Sumac.
Description
This recreates the Zooming Image Tool template for the HTML block. It does it in such a way that doesn't depend on any external resources: both the loupe code and sample image are inlined.
Some benefits to this version are:
We can now maintain the loupe javascript code properly
Because the javascript is included in the contents of the block itself, the course author can customize it as needed
As opposed to the previous iteration, the magnified image URL is now optional: if it's not present, the regular image will be used for magnification
There can now be two or more instances of the tool in the same unit.